package matchesexercise;

public class MatchesDemo {
    public static void main(String[] args) {
        String email="573531647@qq.com";
//        String regex="[a-zA-Z0-9_]+@[[a-zA-Z0-9]\\.]+";
        String regex="[a-zA-Z0-9]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+";

        boolean match=email.matches(regex);
        if (match){
            System.out.println("邮箱的格式正确");
        }else{
            System.out.println("邮箱的格式错误");
        }
    }
}
